home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Almathera Ten Pack 2: CDPD 1
/
Almathera Ten on Ten - Disc 2: CDPD 1.iso
/
pd
/
351-375
/
359
/
dice
/
dice.lzh
/
lib
/
string
/
strncpy.c
< prev
next >
Wrap
C/C++ Source or Header
|
1990-03-27
|
290b
|
29 lines
/*
* STRNCPY.C
*
* (c)Copyright 1990, Matthew Dillon, All Rights Reserved
*/
#include <string.h>
char *
strncpy(d, s, n)
char *d;
const char *s;
{
char c;
char *base = d;
while(n && (c = *s)) {
*d = c;
++s;
++d;
--n;
}
if (n)
*d = 0;
return(base);
}